package com.example.order.controller;

import com.example.order.model.OrderDetail;
import com.example.order.service.OrderDetailService;
import com.example.order.tools.ResponseBody;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("detail")
public class OrderDetailController {
    @Autowired
    private OrderDetailService orderDetailService;

    /**
     * 根据订单id拿到订单详情菜品列表
     * @return
     */
    @RequestMapping("/list")
    public ResponseBody getList(int oid){
        List<OrderDetail> list = null;
        list = orderDetailService.getList(oid);
        return new ResponseBody(0 , "" , list);
    }
}
